package cn.sccdlg.spring5.xmlioc.service.impl;

import cn.sccdlg.spring5.xmlioc.dao.AccountDao;
import cn.sccdlg.spring5.xmlioc.domain.Account;
import cn.sccdlg.spring5.xmlioc.service.AccountService;

import java.util.List;

/**
 * @author RaoShuang
 * @emil 991207823@qq.com
 * @date 2020/10/18 22:37
 * 账户的业务层实现类
 */
public class AccountServiceImpl implements AccountService {
    /**
     * 账户持久层对象
     */
    private AccountDao accountDao;

    /**
     * 设置账户dao对象
     */
    public void setAccountDao(AccountDao accountDao) {
        this.accountDao = accountDao;
    }

    @Override
    public List<Account> findAllAccount() {
        return accountDao.findAllAccount();
    }

    @Override
    public Account findAccountById(Integer accountId) {
        return accountDao.findAccountById(accountId);
    }

    @Override
    public void saveAccount(Account account) {
        accountDao.saveAccount(account);
    }

    @Override
    public void updateAccount(Account account) {
        accountDao.updateAccount(account);
    }

    @Override
    public void deleteAccount(Integer acccountId) {
        accountDao.deleteAccount(acccountId);
    }
}
